package com.supermarket.controller;

import com.supermarket.entity.Role;
import com.supermarket.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private RoleService roleService;
    @GetMapping("{id}")
    public Role getRole(@PathVariable Long id) {
        return roleService.getById(id);
    }

}
